package com.songminju.jsong_httpserver.server.bio;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;

import com.songminju.jsong_httpserver.http.HttpRequest;
import com.songminju.jsong_httpserver.http.HttpResponse;
import com.songminju.jsong_httpserver.http.impl.DefaultHttpRequest;
import com.songminju.jsong_httpserver.http.impl.DefaultHttpResponse;

public class HttpEncoder{

	public HttpRequest resoveRequest(Socket socket) {
		BufferedReader br = null;
		try {
			br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
		} catch (IOException e) {
			e.printStackTrace();
		}
		return DefaultHttpRequest.createRequest(br);
	}
	
	public HttpResponse resoveResponse(Socket socket) {
		return DefaultHttpResponse.createResponse(socket);
	}
}
